library(shiny)
shinyServer(
  function(input,output){
    
    colm <- reactive({
      as.numeric(input$var)
    })
    
    output$text1 <- renderText({
      paste("Data set variable/column name is", names(iris[colm()]))
    })
    
    output$text2 <- renderText({
      paste("Color of histogram is", input$color)
    })
    
    output$text3 <- renderText({
      paste("Nubmer of histogram BINs is", input$bins)
    })
    

    
    # output$sum <- renderPrint({
    #   summary(iris)
    # })
    # 
    # output$str <- renderPrint({
    #   str(iris)
    # })
    # 
    # ## out put data infromation
    # output$data <- renderTable({
    #  colm <-  as.numeric(input$var)
    #   iris[colm]
    #   
    # })
    
    output$myhist <- renderPlot({
      colm <- as.numeric(input$var)
      hist(iris[,colm()],breaks= seq(0, max(iris[,colm()], l = input$bins+1)),
           col = input$color
      )
    })
    
  }
)